import rxAjax from '@/assets/js/ajax.js';
import FormPcApi from "@/api/form/core/formPc";

//数据关联删除约束 api接口
export const FormEntRelationApi = {};

FormEntRelationApi.baseUrl= '/api-form/form/core/formEntRelation';
FormEntRelationApi.exportUrl= FormEntRelationApi.baseUrl + '/listExport';

//查询列表
FormEntRelationApi.query=function (parameter) {
  var url= FormEntRelationApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
FormEntRelationApi.get =function(pkId) {
  var url= FormEntRelationApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
FormEntRelationApi.save =function(parameter) {
  var url= FormEntRelationApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
FormEntRelationApi.del =function(parameter) {
  var url= FormEntRelationApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

//判断是否能删除
FormEntRelationApi.isDeleteByFormSolAlias =function(parameter) {
    var url= FormEntRelationApi.baseUrl + '/isDeleteByFormSolAlias';
    return rxAjax.postJson(url, parameter);
}

FormEntRelationApi.update=function(parameter){
    var url= FormEntRelationApi.baseUrl + "/update";
    return rxAjax.postJson(url,parameter);
}

FormEntRelationApi.updExport=function(ids){
    var url= FormEntRelationApi.baseUrl+'/updExport';
    return rxAjax.postForm(url, {ids:ids});
}

export  default FormEntRelationApi;

